package com.ruoyi.web.controller.mongo;

import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.mongo.comprehensive.SeniorChinToEng;
import com.ruoyi.mongo.senior.service.SeniorInterface;
import com.ruoyi.mongo.word.service.WordListMongoInterface;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/write")
public class WriteController {

    @Autowired
    private WordListMongoInterface wordListMongoInterface;

    @Autowired
    private SeniorInterface seniorInterface;

    /**
     * 汉译英详情
     * 高中
     * 列表
     */
    @GetMapping("/getWriteDetailsList")
    public AjaxResult getWriteDetailsList(@RequestParam(required = false) String status,
                                          @RequestParam String practice) {
        List<?> data = wordListMongoInterface.getWriteDetailsList(status, practice);
        return AjaxResult.success(data);
    }

    /**
     * 汉译英详情
     * 高中872
     * 列表
     */
    @GetMapping("/writeDetailsList")
    public AjaxResult getWriteDetailsList(@RequestParam(required = false) String practice) {
        List<SeniorChinToEng> list = seniorInterface.selectWriteListByPractice(practice);
        return AjaxResult.success(list);
    }

}
